﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>

    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>

</head>
<body>

  <div class="page-group">
    <div class="page page-current">

      <header class="bar bar-nav fs-header-small">
        <a href="${ctx.host}/profile/courses/${courseRound.id}?type=EDITING"
          class="icon icon-left pull-left"></a>
        <h1 class="title">三围数据</h1>
      </header>

      <div class="content" ${courseRound.courseType.online ? 'style="margin-bottom: 2.7rem;"' : ''}>
      
        <c:if test="${empty bwhRecords}">
          <div class="list-block media-list" style="margin-top:1.2rem">
            <p class="text-center">暂无符合条件的三围记录</p>
          </div>
        </c:if>
        
        <c:if test="${not empty bwhRecords}">
            <c:forEach var="record" items="${bwhRecords}">
              
              <div class="content-block-title record-title text-center">
                  <span>
                    <fmt:formatDate value="${record.recordTimeToDate()}" pattern="yyyy-MM-dd" />
                  </span>
                </div>
                
                <div class="list-block">
                  <ul>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title">胸围</div>
                        <div class="item-after">${record.bust}</div>
                      </div>
                    </li>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title">腰围</div>
                        <div class="item-after">${record.waist}</div>
                      </div>
                    </li>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title">臀围</div>
                        <div class="item-after">${record.hips}</div>
                      </div>
                    </li>
                    <c:if test="${courseRound.courseType.online}">
                      <li class="item-content">
                        <div class="item-inner">
                          <div class="item-title">体重</div>
                          <div class="item-after">${record.weight}</div>
                        </div>
                      </li>
                    </c:if>
                  </ul>
                </div>
            </c:forEach>
        </c:if>
        
      </div>
      
      <c:if test="${courseRound.courseType.online}">
        <c:choose>
          <c:when test="${couldRecord}">
            <nav class="bar bar-footer product-detail-footer" style="margin-right: 0;">
              <a href="${ctx.host}/profile/courses/${courseRound.id}/bmr-records/create" class="button button-fill button-buy" style="margin-right: 0;">记录</a>
            </nav>
          </c:when>
          <c:otherwise>
            <nav class="bar bar-footer product-detail-footer" style="margin-right: 0;">
              <a href="javascrip:void();" class="button button-fill button-buy" style="margin-right: 0;background-color: #cecece;">每周只能记录一次三围数据</a>
            </nav>
          </c:otherwise>
        </c:choose>
      </c:if>
    </div>
  </div>

</body>
</html>